namespace Repositories.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class updateForeignId : DbMigration
    {
        public override void Up()
        {
            RenameColumn(table: "dbo.Payment", name: "Applicant_ID", newName: "ApplicantId");
            RenameColumn(table: "dbo.Payment", name: "Audit_ID", newName: "AuditId");
            RenameColumn(table: "dbo.Insurance", name: "Buyer_ID", newName: "BuyerId");
            RenameColumn(table: "dbo.Invoice", name: "Applicant_ID", newName: "ApplicantId");
            RenameColumn(table: "dbo.Invoice", name: "Auditor_ID", newName: "AuditorId");
            RenameIndex(table: "dbo.Payment", name: "IX_Applicant_ID", newName: "IX_ApplicantId");
            RenameIndex(table: "dbo.Payment", name: "IX_Audit_ID", newName: "IX_AuditId");
            RenameIndex(table: "dbo.Insurance", name: "IX_Buyer_ID", newName: "IX_BuyerId");
            RenameIndex(table: "dbo.Invoice", name: "IX_Applicant_ID", newName: "IX_ApplicantId");
            RenameIndex(table: "dbo.Invoice", name: "IX_Auditor_ID", newName: "IX_AuditorId");
            AddColumn("dbo.Payment", "Type", c => c.Int(nullable: false));
        }
        
        public override void Down()
        {
            DropColumn("dbo.Payment", "Type");
            RenameIndex(table: "dbo.Invoice", name: "IX_AuditorId", newName: "IX_Auditor_ID");
            RenameIndex(table: "dbo.Invoice", name: "IX_ApplicantId", newName: "IX_Applicant_ID");
            RenameIndex(table: "dbo.Insurance", name: "IX_BuyerId", newName: "IX_Buyer_ID");
            RenameIndex(table: "dbo.Payment", name: "IX_AuditId", newName: "IX_Audit_ID");
            RenameIndex(table: "dbo.Payment", name: "IX_ApplicantId", newName: "IX_Applicant_ID");
            RenameColumn(table: "dbo.Invoice", name: "AuditorId", newName: "Auditor_ID");
            RenameColumn(table: "dbo.Invoice", name: "ApplicantId", newName: "Applicant_ID");
            RenameColumn(table: "dbo.Insurance", name: "BuyerId", newName: "Buyer_ID");
            RenameColumn(table: "dbo.Payment", name: "AuditId", newName: "Audit_ID");
            RenameColumn(table: "dbo.Payment", name: "ApplicantId", newName: "Applicant_ID");
        }
    }
}
